package com.example.onlinemonitoring.serviceImpl;

import com.example.onlinemonitoring.model.Bxsusbpdsensor;
import com.example.onlinemonitoring.model.Oilconfig;
import com.example.onlinemonitoring.model.Bxsusbpdhistory;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.example.onlinemonitoring.Util.tem.SensorAbstractBaseService;
import com.example.onlinemonitoring.dao.BxsusbpdhistoryMapper;
import com.example.onlinemonitoring.dao.BxsusbpdsensorMapper;
import com.example.onlinemonitoring.dao.OilconfigMapper;
import com.example.onlinemonitoring.service.BxsusbpdsensorService;

import tk.mybatis.mapper.entity.Example;

import com.example.onlinemonitoring.model.common.chartres;
import com.example.onlinemonitoring.Util.HexUtil;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;

/**
* @description Bxsusbpdsensor接口实现
* @author  generator
* @since  2023-08-01 16:50:46
*/
@Service("bxsusbpdServiceImpl")
public class BxsusbpdsensorServiceImpl extends SensorAbstractBaseService<Bxsusbpdsensor, Bxsusbpdhistory> implements BxsusbpdsensorService {
     //这里需要重写getDt方法,用来处理图表数据
    //public String[] getDt(List<Bxsusbpdhistory> list,String[] dt,chartres cts,float[][] sres,SimpleDateFormat sdf,SimpleDateFormat csdf,SimpleDateFormat sdf2){return null;}
    @Autowired
    BxsusbpdhistoryMapper bxshismapper;
        public int Delete(Bxsusbpdhistory record) {
        Example example = new Example(Bxsusbpdhistory.class);
        Example.Criteria criteria = example.createCriteria();
        if (record.getStationid() != null) {
            criteria.andEqualTo("stationid", record.getStationid());
        }
        if (record.getDevicegroup() != null) {
            criteria.andEqualTo("devicegroup", record.getDevicegroup());
        }
        if (record.getDeviceaddr() != null) {
            criteria.andEqualTo("deviceaddr", record.getDeviceaddr());
        }
        return bxshismapper.deleteByExample(example);
    }
}
